﻿/***************************************************
//  Copyright (c) Premium Tax Free 2011
***************************************************/

using System.Net;
using System.Web.Services.Protocols;

namespace PremierTaxFree.PTFLib.Web
{
    public partial class ReceivingWebService
    {
        //public AuthHeaderClass AuthHeader { get; set; }

        public void SetUrl(string url)
        {
            this.Url = url;
        }

        //public void SetCreditails(string userName, string pass)
        //{
        //    AuthHeader = new AuthHeaderClass(userName, pass);
        //}

        public void SetCreditails(string userName, string pass, string domain)
        {
            this.UseDefaultCredentials = false;
            this.PreAuthenticate = true;
            this.Credentials = new NetworkCredential(userName, pass, domain);
        }
    }

    public class AuthHeaderClass : SoapHeader
    {
        public string UserName;
        public string Password;

        public AuthHeaderClass(string user, string pass)
        {
            UserName = user;
            Password = pass;
        }
    }
}
